<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script charset="utf-8" th:src="@{/lib/layui-v2.6.3/layui.js}"></script>
    <link media="all" rel="stylesheet" th:href="@{/lib/layui-v2.6.3/css/layui.css}">
    <script charset="utf-8" th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}"></script>
    <script charset="UTF-8" th:src="@{/frontstatic/js/notify.js}"></script>
    <script charset="UTF-8" th:src="@{/frontstatic/js/notify_stand.js}"></script>
</head>
<body>
<form class="layui-form" style="margin-left: 200px;margin-top: 100px">
    <div class="layui-form-item" id="brandAdddiv">
        <label class="layui-form-label">物流单号：</label>
        <div class="layui-input-inline">
            <input autocomplete="off" class="layui-input" id="BrandName" lay-verify="required" placeholder="请输入"
                   required type="text">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="margin-top: 50px;margin-left: 190px">
            <button class="layui-btn layui-btn-normal" id="addBrandBtn" type="button">确定</button>
        </div>
    </div>
</form>
</body>
<script>
    var notify;
    layui.use(['notify'],function(){
        notify=layui.notify;
    })
    layui.use('form', function () {
        var layer = layui.layer;
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
            return null;
        }
        var id = getQueryString("id");
        var orderid = getQueryString("orderid");
        $("#addBrandBtn").on('click', function () {
            var val = $("#BrandName").val();
            if (val == "") {
                layer.msg("输入不能为空")
            } else {
                var dataVo={
                    "id":id,
                    "orderId":orderid,
                    "oddNumbers":val,
                    "statics":4,
                    "flag":10
                }
                $.ajax({
                    type : "POST",
                    contentType: "application/json; charset=utf-8",
                    data: JSON.stringify(dataVo),
                    dataType: "json",
                    url:"/reterngood/update",
                    async : true,
                    success : function(date){
                        if (date.code==0) {
                            notify.success(date.msg)
                        }else {
                            notify.error(date.msg)
                        }
                    }
                })
            }
        })
    })

</script>
</html>